<template>
  <div :style="{width,height}" class="dialog" v-if="showFlag">
    <h1>{{ title}}</h1>
    <main>
      <slot></slot>
    </main>

  </div>
</template>
<script>
export default {
  name: '',
  props: {
    showFlag: Boolean,
    width: {
      type: String,
      default: '50%'
    },
    height: {
      type: String,
      default: '50%'
    },
    title: {
      type: String
    }
  },
  data () {
    return {

    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    
  }
}
</script>
<style lang='less'  scoped>
.dialog {
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: auto;

  display: flex;
  justify-content: space-between;
  flex-direction: column;
  padding: 10px;
  h1 {
    color: #fff;
  }
  main {
    flex: 1;
  }
  /* 
  opacity====设置透明会影响盒子里面的所有内容的透明度
  rgba===只会影响背景不会影响内容的透明度
  */

  /* 
  组件的说明文档
  属性          类型        默认值
  showFlag      boolean      false
  
  
  */
}
</style>

